<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="转库单" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <div class="operate-bar col-xs-4 font-0">
                        <button class="btn btn-operate m-r-sm" ng-click="addData()"
                                ng-disabled="!btnPermission.materialTransferAdd" translate translate-attr-title="{{!btnPermission.materialTransferAdd?'无权限执行此操作':''}}">新增非条码化转库单
                        </button>
                    </div>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" translate translate-attr-title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" translate translate-attr-title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color" ng-if="!!btnPermission.materialTransferExport">
                            <div translate translate-attr-title="导出" yb-download download-url="exportParam.allUrl" download-param="condition" download-duration="3">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')" translate-attr-title="高级搜索" translate="高级搜索more"></button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" translate translate-attr-placeholder="转库单号"
                               ng-model="condition.transferOrder">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)" translate>搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)" reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>转库单号</span>：</label>
                        <input type="text" class="form-control"  translate translate-attr-placeholder="转库单号" ng-model="condition.transferOrder">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>零件号</span>：</label>
                        <input type="text" class="form-control" translate translate-attr-placeholder="零件号" ng-model="condition.materialNo">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>原储位</span>：</label>
                        <input type="text" class="form-control" translate translate-attr-placeholder="仓库编码" ng-model="condition.preLocationCode">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>新储位</span>：</label>
                        <input type="text" class="form-control" translate translate-attr-placeholder="库区" ng-model="condition.newLocationCode">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>SAP同步状态</span>：</label>
                        <select name="typeId" class="form-control" ng-model="condition.sapStatus"
                                ng-options="item.id as (item.name| translate) for item in sapState">
                            <option value="" translate>请选择</option>
                        </select>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"><span translate>制单时间</span>：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.createDateStart"
                               datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDataPicker(0)" is-open="datePickerFlag[0]" close-text="关闭"
                               ng-change="checkDate(condition, 'createDateStart', 'createDateEnd')" modal-size="small" readonly>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.createDateEnd"
                               datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDataPicker(1)" is-open="datePickerFlag[1]" close-text="关闭"
                               ng-change="checkDate(condition, 'createDateStart', 'createDateEnd')" modal-size="small" readonly>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                            <tr>
                                <th class="border-l-none" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth" fixed-width="tbStyle.billFixedWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots border-l-none" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="详情" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="m-t-sm form-up-tb clearfix">
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>转库单号</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{transferObj.headerInfo.transferOrder || '-'}}">
                        {{transferObj.headerInfo.transferOrder || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>转库类型</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{transferObj.headerInfo.type===0?"零件转移":"储位转移" || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>SAP同步状态</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{transferObj.headerInfo.stateShow || '-'}}">
                        {{transferObj.headerInfo.stateShow || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>零件凭证号</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{transferObj.headerInfo.voucherNo || '-'}}">
                        {{transferObj.headerInfo.voucherNo || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>原储位</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{transferObj.headerInfo.preLocationCode  || '-'}}">
                        {{transferObj.headerInfo.preLocationCode || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>原库区</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{transferObj.headerInfo.preAreaCode || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>原SAP库区编码</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{transferObj.headerInfo.preSapArea || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>新储位</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{transferObj.headerInfo.newLocationCode  || '-'}}">
                        {{transferObj.headerInfo.newLocationCode || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>新库区</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{transferObj.headerInfo.newAreaCode || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>新SAP库区编码</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{transferObj.headerInfo.newSapArea || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>制单人</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{transferObj.headerInfo.createName || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>制单部门</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{transferObj.headerInfo.deptName || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>制单时间</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots">
                        {{(transferObj.headerInfo.createDate | YbDate:'yyyy-MM-dd HH:mm:ss') || "-"}}
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 m-b-n text-right max-w-100"><span translate>SAP错误信息</span>：</label>
                    <div class="col-xs-8 wrapper-none spill-dots" title="{{transferObj.headerInfo.sapErrorMsg || '-'}}">
                        {{transferObj.headerInfo.sapErrorMsg || "-"}}
                    </div>
                </div>
            </div>
            <div class="panel-bar clearfix">
                <div class="pull-left">
                    <i></i><span translate>零件信息</span>
                </div>
            </div>
            <div class="main-area d-b-60" ng-style="{'top': isEN ? '230px' : '200px'}">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{detailTbConf.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in detailTbConf.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="toSort(detailTbConf.tableCol, $index)" ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="detailTbConf.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="transferObj.detailList.length > 0">
                        <table class="table-fixed border-none" width="{{detailTbConf.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in transferObj.detailList track by $index" ng-class="{'row-selected': $index === markInfo.cueRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots" ng-repeat="itemCol in detailTbConf.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <span ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                    <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)" ng-if="!!itemCol.clickFn">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="transferObj.detailList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="detailPageInfo" yb-refresh="searchDetail()"></div>
            </div>
        </div>
        <div tab heading="新增非条码化转库单" active="activeFlag[2]" ng-if="activeFlag[2]">
            <form name="addForm" class="m-t-sm form-horizontal form-up-tb border-b clearfix" novalidate>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i><span translate>转库类型</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <select class="form-control" ng-model="addInfo.type">
                            <option value="1" translate>储位转移</option>
                            <option value="0" translate>零件转移</option>
                        </select>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i><span translate>原仓库</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div yb-form-clear ng-model="addInfo.oldDepot" select-obj="selectWarehouse('old')"
                             clear-form="clearWarehouse('old')" tips-name="原仓库" form-require="true"></div>
                        <div class="msg-block" ng-if="!addInfo.oldDepot && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                <span translate>请选择原仓库</span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i><span translate>原储位</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div yb-form-clear ng-model="addInfo.oldLocationCode" select-obj="selLocation('old')"
                             clear-form="clearLocation('old')" tips-name="原储位" ng-disabled="!addInfo.oldDepot" form-require="true"></div>
                        <div class="msg-block" ng-if="!addInfo.oldLocationCode && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                <span translate>请选择原储位</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i><span translate>新仓库</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div yb-form-clear ng-model="addInfo.newDepot" select-obj="selectWarehouse('new')"
                             clear-form="clearWarehouse('new')" tips-name="新仓库" input-disabled="!addInfo.oldDepot" form-require="true"></div>
                        <div class="msg-block" ng-if="!addInfo.newDepot && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                <span translate>请选择新仓库</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group col-xs-3 m-b-sm">
                    <label class="col-xs-4 control-label max-w-100"><i>*</i><span translate>新储位</span>：</label>
                    <div class="col-xs-8 wrapper-none">
                        <div yb-form-clear ng-model="addInfo.newLocationCode" select-obj="selLocation('new')"
                             clear-form="clearLocation('new')" tips-name="新储位" input-disabled="!addInfo.newDepot" form-require="true"></div>
                        <div class="msg-block" ng-if="!addInfo.newLocationCode && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                <span translate>请选择新储位</span>
                            </div>
                        </div>
                        <div class="msg-block" ng-if="!!addInfo.newLocationCode && (addInfo.oldLocationCode === addInfo.newLocationCode) && submitted">
                            <div class="error-msg">
                                <div class="msg-triangle"></div>
                                <span translate>新储位不能跟原储位相同</span>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
            <div class="panel-bar clearfix">
                <div class="pull-left">
                    <i></i><span translate>零件信息</span>
                </div>
            </div>
            <div class="main-area d-b-60" style="top:180px">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table-fixed border-none" width="{{tableMaterialConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th width="40" class="th-check text-center" ng-if="addInfo.type == 0">
                                    <div yb-check-box yb-checked="markInfo.allChecked" yb-click="selectAll()"></div>
                                </th>
                                <th ng-repeat="itemCol in tableMaterialConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-click="materialToSort(tableMaterialConfig.tableCol, $index)"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed && (itemCol.type!=='cost'||costPriceShow)">
                                    <div yb-thead-operate ng-model="itemCol" target-width="purchaseTbConf.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="addInfo.materialList.length > 0">
                        <table class="table-fixed border-none" width="{{tableMaterialConfig.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in addInfo.materialList track by $index">
                                <td width="40" class="text-center" ng-if="addInfo.type == 0">
                                    <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item)"></div>
                                </td>
                                <td ng-repeat="itemCol in tableMaterialConfig.tableCol" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed && (itemCol.type!=='cost'||costPriceShow)">
                                    <div class="spill-dots" ng-if="!itemCol.isInput || (itemCol.isInput && addInfo.type == 1)" title="{{item[itemCol.dataField]}}">
                                        <span ng-if="!itemCol.clickFn">
                                            {{item[itemCol.dataField]}}
                                        </span>
                                    </div>
                                    <div class="td-edit pos-r" ng-if="itemCol.isInput && addInfo.type == 0">
                                        <input type="text" class="form-control" ng-model="item[itemCol.dataField]"
                                               yb-number-input disable-decimal="false" min="1" max="item.amount">
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="addInfo.materialList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area btn-bar text-center clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(addForm.$valid)" translate>提交</button>
                <button type="button" class="btn btn-default" ng-click="changeTab(0)" translate>取消</button>
            </div>
        </div>
    </div>
</div>